<?php
/**
 * 话题主页
 */
require_once dirname(dirname(__DIR__))."/common.php";

use app\cls\tom\Response;
use app\cls\tom\SysResource;
use app\model\Topic;
//分页
$page = isset($_REQUEST["page"]) ? intval($_REQUEST["page"]) : 1;
$page = $page > 0 ? $page : 1;
$pageSize = 10;

$sub_id=$_REQUEST['sub_id'];
if(empty($sub_id)){
    Response::output(-1,"缺少参数");
}
//实例化数据库
$db = SysResource::getDB(false);
$Topic = new Topic($db);
$data=$Topic->topic_slide($page,$pageSize,$sub_id);
if(!empty($data)){
    Response::output(0,"查询成功",$data);
}else{
    Response::output(0,"查询成功",[]);
}